<?php

/*
 * Niken Larasati
 * larasati.n@students.amikom.ac.id
 */

class kk extends CI_Controller {

    public function __construct() {
        parent::__construct();
    }

    function formkk() {
        $this->template->load('halaman_v', 'formkk_v');
    }

    function tambah() {
        if ($this->input->post('tambah') != NULL) {
            $data['no_kk'] = $this->input->post('kk');
            $data['nik'] = $this->input->post('nik');
            $data['alamat'] = $this->input->post('alamat');
            $data['rt'] = $this->input->post('rt');
            $data['rw'] = $this->input->post('rw');
            $data['id_status_kk'] = $this->input->post('status_kk');
            $data['tgl_pembuatan'] = $this->input->post('tgl_buat');

            $this->load->model('umum_m');
            $this->umum_m->tambah('kk', $data);
        }
    }
    
    function ambil_data(){
        $this->load->model('kk_m');
        $data['data'] = $this->kk_m->ambil_data();
        $this->template->load('halaman_v','laporan_kk_v',$data);
    }

}

?>
